home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16452 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 10 Apr 1996 17:56:51 -0500
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4khebk$rak@solutions.solon.com>
  8. References: <dewar.828846122@schonberg> <828903511snz@genesis.demon.co.uk> <4kgjrc$4d@news.nyu.edu>
  9. Reply-To: seebs@solon.com
  10. NNTP-Posting-Host: solutions.solon.com
  11.  
  12. In article <4kgjrc$4d@news.nyu.edu>, halvin <halvin@acf4.nyu.edu> wrote:
  13. >this might be slightly off-topic, but isn't there a difference between the
  14. >ANSI and POSIX versions of fprintf? if i remember correctly, the ANSI version
  15. >returns 0 on success and EOF on failure -- but the POSIX version returns the
  16. >number of characters printed, or a negative number to indicate failure.
  17.  
  18. ANSI fprintf returns # bytes written also.
  19.  
  20. >so which behavior should one expect in an ANSI C application that happens
  21. >to run in a POSIX-compliant environment? a student stumbled upon this issue,
  22. >and i didn't really have an answer, as i had thought that POSIX was a proper
  23. >superset of ANSI C.
  24.  
  25. Assuming that they disagreed, an ANSI C application would expect the ANSI
  26. behavior, and a POSIX application would expect the POSIX behavior.
  27. How you tell which you are?  Simple!  If you use extensions of POSIX,
  28. you're POSIX.
  29.  
  30. But since they agree, it's a moot point.  :)
  31.  
  32. -s
  33. -- 
  34. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  35. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  36. FUCK the communications decency act.  Goddamned government.  [literally.]
  37. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  38.